import sys

result = {}

for i in range(0, 110):
    result[str(i) + "max"] = -9999999.0

for data in sys.stdin:
    data = data.strip()
    attri_arr = data.split(",")

    attr_num = 0
    for attri in attri_arr:
        attri_num = float(attri)
        if attri_num > result[str(attr_num)+"max"]:
            result[str(attr_num)+"max"] = attri_num
        attr_num = attr_num + 1

for key, value in result.items():
	sys.stdout.write("%s\t%s\n" % (key, str(value)))